.class public Llt/noframe/gpsfarmguide/states/map_states/SprayState;
.super Ljava/lang/Object;
.source "SprayState.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/states/map_states/MapState;


# direct methods
.method public constructor <init>(Llt/noframe/gpsfarmguide/models/MeasuringModel;)V
    .locals 6

    .line 22
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 23
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    .line 24
    new-instance v1, Llt/noframe/gpsfarmguide/gui/GuiFactory;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/gui/GuiFactory;-><init>()V

    const/4 v2, 0x4

    invoke-virtual {v1, v2, p1}, Llt/noframe/gpsfarmguide/gui/GuiFactory;->buildGui(ILlt/noframe/gpsfarmguide/models/MeasuringModel;)V

    .line 25
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->markMeasure()V

    .line 27
    invoke-virtual {v0, v2}, Llt/noframe/gpsfarmguide/Data;->setTool(I)V

    .line 28
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    .line 30
    invoke-static {p1}, Llt/noframe/gpsfarmguide/utils/LastPickPrefrences;->getNavigationType(Landroid/content/Context;)I

    move-result v1

    .line 32
    new-instance v2, Llt/noframe/gpsfarmguide/sprayer/SprayController;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/utils/LastPickPrefrences;->getEquipmentWidth(Landroid/content/Context;)D

    move-result-wide v3

    invoke-direct {v2, p1, v3, v4, v1}, Llt/noframe/gpsfarmguide/sprayer/SprayController;-><init>(Landroid/content/Context;DI)V

    iput-object v2, v0, Llt/noframe/gpsfarmguide/Data;->sprayFunction:Llt/noframe/gpsfarmguide/sprayer/SprayController;

    .line 34
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getDisplayTrackInMap()Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 35
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getDisplayTrackInMap()Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;

    move-result-object p1

    .line 36
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->isPolyline()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 37
    iget-object v1, v0, Llt/noframe/gpsfarmguide/Data;->sprayFunction:Llt/noframe/gpsfarmguide/sprayer/SprayController;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getTrackInMapPolyline()Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;

    move-result-object v2

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->getPolys()Ljava/util/List;

    move-result-object v2

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getTrack()Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v3

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getArea()D

    move-result-wide v4

    invoke-virtual {v1, v2, v3, v4, v5}, Llt/noframe/gpsfarmguide/sprayer/SprayController;->initSprayPolyline(Ljava/util/List;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;D)I

    goto :goto_0

    .line 39
    :cond_0
    iget-object v1, v0, Llt/noframe/gpsfarmguide/Data;->sprayFunction:Llt/noframe/gpsfarmguide/sprayer/SprayController;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getTrackInMapPolygon()Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;

    move-result-object v2

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolygon;->getPolys()Ljava/util/List;

    move-result-object v2

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getTrack()Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object v3

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMap;->getArea()D

    move-result-wide v4

    invoke-virtual {v1, v2, v3, v4, v5}, Llt/noframe/gpsfarmguide/sprayer/SprayController;->initSprayPolygons(Ljava/util/List;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;D)I

    goto :goto_0

    .line 42
    :cond_1
    sget-object v1, Llt/noframe/gpsfarmguide/utils/Preferences;->AREA_SHOWN_AS_POLYLINE:Llt/minvib/magicpreferences/MagicBooleanPreference;

    invoke-virtual {v1, p1}, Llt/minvib/magicpreferences/MagicBooleanPreference;->get(Landroid/content/Context;)Ljava/lang/Boolean;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    const-wide/16 v1, 0x0

    const/4 v3, 0x0

    if-eqz p1, :cond_2

    .line 43
    iget-object p1, v0, Llt/noframe/gpsfarmguide/Data;->sprayFunction:Llt/noframe/gpsfarmguide/sprayer/SprayController;

    invoke-virtual {p1, v3, v3, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/SprayController;->initSprayPolyline(Ljava/util/List;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;D)I

    goto :goto_0

    .line 45
    :cond_2
    iget-object p1, v0, Llt/noframe/gpsfarmguide/Data;->sprayFunction:Llt/noframe/gpsfarmguide/sprayer/SprayController;

    invoke-virtual {p1, v3, v3, v1, v2}, Llt/noframe/gpsfarmguide/sprayer/SprayController;->initSprayPolygons(Ljava/util/List;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;D)I

    .line 50
    :goto_0
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton1()Landroid/view/MenuItem;

    move-result-object p1

    const/4 v1, 0x0

    invoke-interface {p1, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 51
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton2()Landroid/view/MenuItem;

    move-result-object p1

    invoke-interface {p1, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 52
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton3()Landroid/view/MenuItem;

    move-result-object p1

    invoke-interface {p1, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 53
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getLayersButton()Landroid/view/MenuItem;

    move-result-object p1

    invoke-interface {p1, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 54
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object p1

    const/16 v1, 0x8

    invoke-virtual {p1, v1}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 55
    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 56
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    check-cast p1, Llt/noframe/gpsfarmguide/views/ActivityDrawer;

    const/4 v0, 0x1

    invoke-virtual {p1, v0}, Llt/noframe/gpsfarmguide/views/ActivityDrawer;->setDrawerLocked(Z)V

    .line 58
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    const-string v0, "navigation_started"

    invoke-static {v0, p1}, Llt/noframe/gpsfarmguide/App;->stateChanged(Ljava/lang/String;Landroid/content/Context;)V

    return-void
.end method


# virtual methods
.method public button1()V
    .locals 0

    return-void
.end method

.method public button2()V
    .locals 0

    return-void
.end method

.method public button3()V
    .locals 0

    return-void
.end method

.method public buttonCenter()V
    .locals 0

    return-void
.end method

.method public buttonZoom()V
    .locals 2

    .line 71
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x2

    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/utils/Camera;->showMeasure(Ljava/util/List;I)V

    return-void
.end method

.method public onBackPressed()V
    .locals 1

    .line 79
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getNavigationBottom()Llt/noframe/gpsfarmguide/widgets/BottomNavigationBar/BottomBar;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/widgets/BottomNavigationBar/BottomBar;->stopClick()V

    return-void
.end method
